/*$('#but_1').click(function(){
    var layer_1=parent.layer;
    layer_1.close(layer_1.index);
})
$('#but_2').click(function(){
    //商品名称:
    var remarks=document.getElementById("remarks").value;
    //商品分类:
    var select1=$("#select_id").find("option:selected").val();
    //商品现价:
    var email=document.getElementById("email").value;
    //商品原价::
    var position_id=document.getElementById("position_id").value;
    //审核状态:
    var select2=$("#select_id2").find("option:selected").val();
    //上传人员:
    var position=document.getElementById("position").value;
    $.ajax({
        url: '/SyOperationController/CourseReview',//异步调用接口的路径
        type:'post',
        data:{"remarks":remarks,"select1":select1,"email":email,"position_id":position_id,"select2":select2,"position":position},
        success:function(data){
           console.log(data.data)
            stringify("data",data.data)
        }
    })

    var layer_1=parent.layer;
    layer_1.close(layer_1.index);
   // window.parent.location.reload();//刷新父页面
    //存值
    stringify=function (obj,data){

        return window.localStorage.setItem(obj, JSON.stringify(data));

    }
})*/




var form;
var table;
var $;
layui.use(['layer','form','table'],function(){
    form = layui.form;
    table=layui.table;
    $=layui.$;

    //商品分类下拉菜单
    $.ajax({
        url: "/SyOperationController/selProductCategorySelect",
        type: "get",
        dataType: "json",
        success: function (data) {
            var i="<option value=''>请选择商品分类</option>";
            for(var a=0;a<data.data.length;a++){
                i+="<option value='"+data.data[a].category_id+"'>"+data.data[a].categroy_name+"</option>";

            }
            $("#categoryId").html(i);
            form.render();
        }
    });
});

$('#confirm').on('click',function(){
    var productCode=$('input[name=productCode]').val();
    var productName=$('input[name=productName]').val();
    var currentpriceProduct=$('input[name=currentpriceProduct]').val();
    var categoryId=$("#categoryId option:selected").val();
    var trueName=$('input[name=trueName]').val();

    parent.$("input[name='productCode1']").val(productCode);
    parent.$("input[name='productName1']").val(productName);
    parent.$("input[name='currentpriceProduct1']").val(currentpriceProduct);
    parent.$("#categoryId option:selected").val(categoryId);
    parent.$("input[name='trueName1']").val(trueName);

    parent.sousuo();

    var layer_1=parent.layer_1;
    layer_1.close(layer_1.index);
})
//重置
$('#reset').on('click',function(){
    $("input").val("");
    $(this).find("option:selected").removeAttr("selected");
})
